<template>
  <el-dialog v-bind="$attrs">
    <div class="form-wrapper">
      <slot></slot>
    </div>
    <template #footer>
      <slot name="footer"></slot>
    </template>
  </el-dialog>
</template>

<script setup lang="ts">
defineProps({
  title: {
    type: String,
    default: '标题'
  },
  width: {
    type: [String, Number],
    default: 600
  }
})

const emit = defineEmits(['update:modelValue', 'cancel', 'confirm'])
const cancel = () => {
  emit('update:modelValue', false)
  emit('cancel')
}
const confirm = () => {
  emit('confirm')
}
</script>

<style lang="scss" scoped>
.form-wrapper {
  padding: 20px;
}
</style>
